/* eslint-disable no-debugger */
import { useEffect, useState } from 'react';
import styles from './index.module.css';
import { appList } from '@/api';

export default function Home() {
  const [list, setList] = useState([]);
  // const { data, error, loading, request: fetchRepos } = useRequest({ url: '/api/list' });
  // const { dataSource = [] } = data || {};

  useEffect(() => {
    appList({ start: 212102 }).then((res) => {
      setList(res.map((item) => {
        return (
          <li>{item} + 你是一头小猪</li>
        );
      }));
    });
  }, []);

  return (
    <div className={styles.container}>
      <h2>Home page</h2>
      <ul>
        {list}
      </ul>
      {/* {
        error ? (
          <div>request error: {error.message}</div>
        ) : (
          <Table
            loading={loading}
            dataSource={dataSource}
            rowKey="id"
          >
            <Table.Column title="ID" dataIndex="id" key="id" />
            <Table.Column title="名称" dataIndex="name" key="name" />
            <Table.Column title="描述" dataIndex="description" key="description" />
          </Table>
        )
      } */}
    </div>
  );
}
